home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-13
/
texmac.zip
/
SP.SPM
< prev
next >
Wrap
Text File
|
1991-11-26
|
9KB
|
232 lines
;----------------------------------------------
; Copyright (c) 1988 Borland International. All Rights Reserved
;
; RDT default user interface Version 1.
;
; General permission to redistribute, but not for profit, all
; or part of this User Interface program is granted, provided
; that this statement, including the above copyright notice,
; is not removed. You may add your own copyright notice to
; secure copyright protection for new matter that you add to
; the program, but Borland International will not support, nor
; assume any legal responsibility for, material added or changes
; made to this program.
;
; NAME: SP.SPM
;
; DESCRIPTION: NOTHER user interface, heavily modified from:
; Sprint sp.spm, core.spm, fwii.spm, and assorted downloads and my additions and modifications
; LAST UPDATE: September 9, 1988, November 26, 1990, 12/9/90, 2/6/91, 11/24/91
;
; NOTES: merged macros from core, sp. and fwii.spm files, plus my own
; and ones from Compuserve. I have extensively reworked many of those
; in core and sp.spm. Also have attempted to apply consistent nomenclature
; scheme to the naming of macros on the prevalent pattern of object/unit name
; followed by verb/action: WordFwd, WordBack, etc.
;
;----------------------------------------------
; Q register usage:
; *Q0 Scratch: filenames, and the result of imenus, KeyHelp, etc.
; Q1 Destination filename, sort of transient
; Q2 Search string
; Q3 Replace string
; *Q4 DoReplace scratch
; Q5 DOS command
; Q6 Formatter DOS command
; Q7
; Q8 Scratch, file management
; Q9 last File Spec
; QA Used by glossary; holds current glossary Name
; QB Used by glossary; holds glossary
; *QC Scratch: Used by glossary
; *QD Scratch
; QE Used by spelling checker; holds bad word stack
; QF Used to collect keystrokes for replay
; QG MacroExecute
; QH Used by column
; QI Printer Menu settings
; QJ Holds current Speller engine params
; QK Holds a record containing infomerge info.
; QL unused
; QM unused
; QN unused
; QO unused
; QP unused
;-------------------------------------------===
; NUMBERED MARK USAGE:
; 0-9 used as place markers
; A
; B
; C
; D DoRepTest, DoReplace
; E DoRepTest, DoReplace
; F CharFindDelete, WordBackDelete, ColCopy, etc.
;----------------------------------------------
; CONTENTS:
; SECTION: Routines that MUST exist for the compiler to work
; SECTION: Variables -- all the variables are declared here
; SECTION: #include NOTHER.UIM
; SECTION: #include files that stand alone, sort, mouse, drawline
; SECTION: #include MENUS.UIM, KEYS.UIM to complete the picture
;
;----------------------------------------------
#clear
;----------------------------------------------
; SECTION: Routines that MUST exist for the compiler to work
; This function (Bell) must be BUG-FREE or the compiler won't work
; properly (it tries to ring the bell on compilation errors)
; This function nominally takes an argument: 0-mistyped key, 1-error
; message, other-undefined. If this is an IBM-PC, we produce interesting
; sounds by direct hardware manipulation, else we just print a ^G.
Bell :
if isibm sounddur sound
else rawout "^G"
;----------------------------------------------
; SECTION: Variables -- all the variables are declared here
; -----------------------------------------------------------------
; Variables, get saved in ovl file if ovlmodf = 1
int RepCount 4 ; Holds number of iterations for RepeatCount
int RepChar 0
int InRepChar 0
int SaveRight 0
int RepeatRate 50 ; msec/repeat for continuous scrolls
int Mnum ; Keep track of the 10 markers in a ring, apologies to hch
int NextMnum ; next mark to jump To, fwd or back
int n ; declare useful temporary variables
int x
int y
int EraseSwap 0 ; kill swap file on exit
int PArg 50 ; This tells the editor how to load the formatter
; What the bits mean in PArg (and any use of the "call" macro):
; 1 - Do [press any key to continue] (-w) after it returns
; 2 - Pass -p=xxx -z=xxx (not -z, -s) to communicate printer&screen to formatter
; 4 - reserved
; 8 - Run the "restart" macro on reload (only works if bit 16 is on)
; 16- Overlay: clear most of editor from memory to make more room
; for called program, when it returns fool DOS into running
; a new copy of the editor where old one was.
; 32- Don't do "reset" from screen definition (i.e. don't clear it
; for the default IBM definition)
; PArg is 2+16+32. If you subtract 16 it won't overlay and will therefore
; run faster. Paginate adds 8 to run "restart" macro, which reads the .log
; file produced by formatter and inserts the page breaks.
int AppendNext 0 ; set by any deletion commands
int DelAtt 0 ; saved attribute of deleted region, unused by NOTHER.UIM
int ColMode 0 ; column mode 1= on
int ALineLength 65
int WordWrap 0 ; Flag to control word wrap styles separate from ALineLength
int AutoIndent 0 ; 1 = auto indent to line above cursor after [enter]
int Quoted 0 ; Holds last char inserted by Quote macro
int FloppyDisk 0 ; 0=Hard disk, 1=360Ko, 2=720ko, 3=1.2Mo
int WasEngine 0 ; 1=Hyphen or Thesaurus, 2=Speller
; decimal tab routine
int AlignChar '.' ; decimal tab alignment char (',' for Europe)
; hyphenation routines
int HypLen 8 ; minimum word length to hyphenate
int HypAsk 4 ; minimum extra space on a line before considering hyphenating
; keyboard macro routines
int MacroRepCnt 1 ; repeat count
; print options, unnecessary since they're now local to PrintOptions
int GuessCutOff 500 ; if the file has more than this many lines,
; we assume that it needs 2 passes and don't
; search for @ or ^V
int PrintDest 0 ; 0 = printer, 1= file, 2 = screen, 3 = network queue
int Paper 0 ; paper type
; the following globals aren't necessary with PrintOptions in QI
;int AutoFill 0 ; 0 = no fill, 1 = fill yes
;int FirstPage 1 ; starting page
;int GuessResult 1 ; result of Printguess
;int LastPage 0 ; ending page 0 = last page of doc
;int LogErrors 0 ; 0 = no log, 1 = log errors to file.log
;int NumCopies 1 ; number of copies to print
;int PagePause 0 ; 0 = no pause, else, pause
;int Plain 0 ; 0 = normal, 1 = plain
;int PrintPass 0 ; 0 = auto, else, pass to print on + 1
int SaveDest 0 ; used by Spmerge : to preserve PrintDest
; Info Merge options
int LastRec 0 ; last record to merge 0= use all records
int FirstRec 1 ; record to start merge with
int DataFormat 0 ; 0 = std format, 1 = basic file format (remditto)
; search options
int SearchDirection 1 ; 1 = last search was forward, else back
int SearchOpt 1 ; Standard options to search macro
int GlobalSearch 0 ; 1 = search from beginning of file 0 = from point
int GlobalReplace 0 ; passed into DoReplace
int StrFound 0 ; used by DoReplace
; direction / Unit flags
;int Dir 1 ; coordinate with flag4, 0 is reverse, 1 forward
;int TUnit 'w' ; remember most recent unit of text movement, resolve into one
; spelling corrector
int AutoCorrect 0 ; indicates auto-correct
int BadWordPending 0 ; If 1, then a bad word has not been corrected
; GotoLine, now LineJump
int LastLine 0 ; Holds last line user went to w/GotoLine
; keyboard recording
int OldStatLine 1 ; to preserve status line setting
; Insert/Overwrite mode
int InsertMode 0 ; same as overwrite, but kept in overlay to preserve state
; Determines type of call used when running DOS commands. If 0, then Sprint
; will remain in memory, taking away about 220k. If 16, then the editor
; will be overlayed, leaving all but 3k of memory available to it. The
; latter is great for running other applications from within Sprint, but since
; Sprint must reload when being returned to, it is somewhat slower.
int BIGDOS 16
; Return code from overlayed program
int ReturnCode
;----------------------------------------------
; SECTION: #include UIM files
;----------------------------------------------
UISave : $ ovlwrite "nother.ui" ovlwrite "sp"
;SaveUi: UISave ; for compatibility with Core
#include "nother" ; main macro set
#include "column" ; few changes
#include "gloss" ; glossary management, some improvements
#include "spell" ; spelling, thesaurus, few changes
#include "sort" ; has to follow nother, few changes
;----------------------------------------------
; SECTION: #include files that stand alone
; get these files from source.arc
;----------------------------------------------
;#include "colors" ; permanent overlay, it writes the overlay in current dir.
;#include "mouse" ; I don't use these, so omit to save space & time
;#include "drawline"
;----------------------------------------------
; SECTION: #include MENUS, KEYS to complete the picture
;----------------------------------------------
#include "spprint" ; Sprint/Scribe print menu, handle infomerge
#include "tex.spm" ; TeX formatting & menu
#include "pickmac" ; misc. macros in a pick list
#include "menus" ; most menus
#include "keys" ; key assignments
: UISave